package de.jmda.mview.fx.node.typeshape;

import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;

import javax.lang.model.element.TypeElement;

import de.jmda.util.gui.fx.ImageFactory;

public class Title
    extends HBox
{
	private TypeElement typeElement;

	private Label label;

	public Title(TypeElement typeElement)
	{
		super();

		this.typeElement = typeElement;

		init();
	}

	private void init()
	{
		getStyleClass().add("title");

		ImageView imageView =
		    new ImageView(ImageFactory.getImage(typeElement, "png"));

		label = new Label(typeElement.getSimpleName().toString(), imageView);

		getChildren().add(label);
	}
}